#include <stdio.h>
#include <limits.h>
#define INFINITY INT_MAX
#define MAX_VERTEX_NUM 20
#define OK 1
typedef enum
{
    DG,
    DN,
    UDG,
    UDN
} GraphKind;
typedef int VRType;
typedef int InfoType;
typedef struct ArcCell
{
    VRType adj;     // 无权图为0、1，有权图为权
    InfoType *info; // 指向弧的相关信息
} ArcCell, AdjMartix[MAX_VERTEX_NUM][MAX_VERTEX_NUM];
typedef int VertexType;
typedef struct
{
    VertexType vexs[MAX_VERTEX_NUM]; // 图中的节点们
    AdjMartix arcs;
    int vexnum, arcnum;
    GraphKind kind;
} MGraph;
typedef int Status;
int LocateVex(MGraph G, VertexType v)
{
    return v - 1;
}
// 建立无向网(边有权)
Status CreateUDN(MGraph &G)
{
    printf("vexnum & arcnum");
    scanf("%d%d", &G.vexnum, &G.arcnum);
    // 初始化所有图节点
    for (int i = 0; i < G.vexnum; ++i)
    {
        G.vexs[i] = i + 1;
    }
    // 初始化邻接矩阵
    for (int i = 0; i < G.vexnum; ++i)
    {
        for (int j = 0; j < G.vexnum; ++j)
        {
            G.arcs[i][j].adj = INFINITY;
        }
    }
    // 构造邻接矩阵(获取边点关系)
    for (int k = 0; k < G.arcnum; ++k)
    {
        VertexType v1, v2;
        VRType weight;
        scanf("%d%d%d", &v1, &v2, &weight);
        int i = LocateVex(G, v1);
        int j = LocateVex(G, v2);
        G.arcs[i][j].adj = G.arcs[j][i].adj = weight;
    }
    return OK;
}
int main(void)
{

    return 0;
}